/**
 *
 * @param table {Table}
 * @param auth {boolean} 接口是否需要鉴权
 * @param spare {boolean} 是否在生成代码时注释该方法，用于备用
 * @returns {string}
 */
const importPackage = (table, auth = false, spare = false) => {
  const {
    pkg,
    names: {
      TabName,
      JavaName,
      pkgName
    }
  } = table
  return `
import ${pkg}.business.${pkgName}.entity.*;
import ${pkg}.business.${pkgName}.dto.*;
import ${pkg}.business.${pkgName}.service.*;
import com.alibaba.fastjson.JSON;
import com.github.xiaoymin.knife4j.annotations.*;
import com.google.common.collect.*;
import com.support.mvc.encrypt.*;
import com.support.mvc.entity.*;
import com.support.mvc.entity.base.*;
import io.swagger.annotations.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.*;
import com.utils.enums.Code;
import org.springframework.security.core.annotation.AuthenticationPrincipal;

import java.util.*;
import java.util.stream.*;
`
}
export const importPackageOpenInstall = table => importPackage(table)
export const importPackageOpenUninstall = table => importPackage(table, false, true)

export const importPackageAuthInstall = table => importPackage(table, true, false)
export const importPackageAuthUninstall = table => importPackage(table, true, true)
